const MyPromise = require('./myPromise');

let promise = new MyPromise((resolve, reject) => {
  // resolve('success') // 二者只有其一
  reject('failed') // 二者只有其一
})

promise.then(value => {
  console.log(value)
}, error => {
  console.log(error)
})